//
//  NSDate+PPDate.m
//  pickpic
//
//  Created by 胡文广 on 2017/8/3.
//  Copyright © 2017年 MicroDream. All rights reserved.
//

#import "NSDate+PPDate.h"

@implementation NSDate (PPDate)
- (NSInteger)getDifferenceByDate{
    //获得当前时间
    NSDate *now = [NSDate date];
    NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
    unsigned int unitFlags = NSDayCalendarUnit;
    NSDateComponents *comps = [gregorian components:unitFlags fromDate:self toDate:now options:0];
    return [comps day];

}
    

@end
